<template>
  <div class="news-wrapper">
    <div class="inner">
      <div class="title-news">
        <h2>热门房产资讯</h2>
        <div class="subtitle">
          <!-- <span class="more pointer">更多</span> -->
        </div>
      </div>

      <div class="content-news">
        <div class="fl-list">
          <div class="fl-item" @click="topage('realDetail',item.id)" v-for="(item, index) in newsList" :key="index">
            <img
              class="img-left pointer"
              :src="item.banner"
              alt=""
            />
            <div class="text">
              <div class="h3 pointer">
               {{item.title}}
              </div>
              <div class="desc pointer" v-html="item.content"></div>
              <p class="time num">{{item.time}}</p>
            </div>
          </div>
        </div>
        <div class="fr-list">
          <div
            class="fr-item"
            v-for="(item, index) in rNerList"
            :key="index"
          >
            <img
              class="img pointer"
              :src="item.banner"
              alt=""
            />
            <div class="text">
              <div class="h3 pointer">
               {{item.title}}
              </div>
              <p class="time num">{{item.time}}</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { defineComponent ,reactive} from "vue";
import { useRouter } from "vue-router";
import { useStore } from "vuex";
export default defineComponent({
  props: {
      newsList: Array,rNerList: Array
  },
  setup(props) {
    const store = useStore();
    const router = useRouter();
    const topage = (route, id) => {
      router.push({ path: route, query: { id } });
    };
    return {
      topage
    };
  },
});
</script>

<style lang="scss">
.news-wrapper {
  padding: 45px 0 22px;
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  word-break: break-all;
  .inner {
    width: 1200px;
    margin: 0 auto;
    .title-news {
      width: 100%;
      min-height: 38px;
      display: flex;
      justify-content: space-between;
      h2 {
        display: inline-block;
        font-size: 26px;
        line-height: 36px;
        color: #333;
        font-weight: 600;
      }
      .subtitle {
        
        .more {
          float: right;
          font-size: 14px;
          line-height: 24px;
          color: #333;
          &:hover {
            color: #e03236;
          }
        }
      }
    }

    .content-news {
      display: flex;
      justify-content: space-between;
      .fl-list {
        width: 786px;
        .fl-item {
          &:hover {
            background: #f9f9f9;
          }
          &:first-child {
            border-top: none;
          }
          display: flex;
          width: 100%;

          padding: 25px 0;
          border-top: 1px solid #e6e6e6;
          .img-left {
            width: 220px;
            height: 165px;
            margin-right: 20px;
            border-radius: 2px;
            display: inline-block;
          }
          .text {
            padding-right: 10px;
            .h3 {
              font-size: 20px;
              line-height: 28px;
              font-weight: bold;
              &:hover {
                color: #e03236;
              }
            }
            .desc {
              margin-top: 15px;
              font-size: 14px;
              line-height: 20px;
              color: #888888;
              overflow: hidden;
              height: 70px;
            }
            .time {
              margin-top: 15px;
              font-size: 14px;
              color: #999;
              line-height: 20px;
            }
          }
        }
      }
      .fr-list {
        width: 357px;
        padding-top: 15px;
        .fr-item {
          padding: 10px 0;
          display: flex;
          .img {
            width: 110px;
            height: 83px;
            border-radius: 2px;
            margin-right: 15px;
          }
          .text {
            .h3 {
              font-size: 14px;
              line-height: 22px;
              color: #333;
              &:hover {
                color: #e03236;
              }
            }
            .time {
              margin-top: 10px;
              font-size: 14px;
              color: #999;
              line-height: 20px;
            }
          }
        }
      }
    }
  }
}
</style>